1 00:00:00,510 --> 00:00:04,830 All right, Now I have to make my mind blow up when somebody steps on it. 2 00:00:04,830 --> 00:00:08,160 So I'm going to do that with the plate when somebody steps on the plate. 3 00:00:08,160 --> 00:00:10,430 So go to the landmine plate. 4 00:00:10,440 --> 00:00:11,850 Now, there's already explosion. 5 00:00:11,850 --> 00:00:13,140 Sound on it. 6 00:00:13,140 --> 00:00:14,430 We're going to need that. 7 00:00:14,430 --> 00:00:16,190 But hit the plus on the plate. 8 00:00:16,200 --> 00:00:21,840 I had a script and the script is going to be I'll call that boom. 9 00:00:23,910 --> 00:00:25,410 We need a few variables. 10 00:00:25,410 --> 00:00:27,330 The plate is going to be the main one, right? 11 00:00:27,330 --> 00:00:27,900 So let's go. 12 00:00:27,900 --> 00:00:32,130 Local plate equals and it just script off parent. 13 00:00:33,030 --> 00:00:38,400 But we're also going to need a variable for the model because we have to do a cleanup once that blows 14 00:00:38,400 --> 00:00:43,230 up, let's say a local land mine. 15 00:00:43,230 --> 00:00:44,250 So we all make that one. 16 00:00:44,280 --> 00:00:45,480 Just make that one word. 17 00:00:45,480 --> 00:00:51,330 No caps, landmine plate dot parent Right. 18 00:00:51,330 --> 00:00:52,770 So the script is here. 19 00:00:52,800 --> 00:00:54,330 The parent of that is the plate. 20 00:00:54,330 --> 00:00:56,130 The parent of that is the landmine. 21 00:00:57,450 --> 00:00:57,780 All right. 22 00:00:57,780 --> 00:01:01,710 We need a variable for whether it can or can't explode. 23 00:01:01,710 --> 00:01:03,810 So I'll say can explode. 24 00:01:03,810 --> 00:01:06,780 So once it blows up, we're going to turn it off that way. 25 00:01:06,780 --> 00:01:11,310 The piece is the plate that goes flying doesn't hit somebody else and blow up again. 26 00:01:11,310 --> 00:01:15,210 So I'll say true to start out for can explode. 27 00:01:15,900 --> 00:01:19,590 We're also going to need the debris service to clean it up. 28 00:01:19,620 --> 00:01:29,580 They get rid of it after everything is done in the workspace, we'll say gain, get service debris and 29 00:01:29,580 --> 00:01:30,390 we're going to clone it. 30 00:01:30,390 --> 00:01:32,040 We're going to spawn these, right. 31 00:01:32,040 --> 00:01:33,300 Periodically spawn these. 32 00:01:33,300 --> 00:01:34,470 So we need to clean them up. 33 00:01:34,860 --> 00:01:35,280 Now. 34 00:01:35,280 --> 00:01:41,820 I'm going to get my sound send that's on the plate right there, the plate dot. 35 00:01:41,820 --> 00:01:44,070 And it's this one right here, explosion. 36 00:01:45,270 --> 00:01:46,170 There it is. 37 00:01:47,520 --> 00:01:52,320 Oh, and I want this to explode if anything hits it. 38 00:01:52,320 --> 00:01:54,960 So if we go ahead and kick a ball on it, boom. 39 00:01:54,960 --> 00:02:02,040 But we don't want it to explode by the ground or the surface that it's sitting on, in this case, it's 40 00:02:02,040 --> 00:02:03,330 sitting on the terrain. 41 00:02:03,330 --> 00:02:06,300 So if you have a floor, pay attention to this. 42 00:02:06,300 --> 00:02:08,100 You're going to have to modify this a little bit. 43 00:02:08,370 --> 00:02:19,200 I'm going to go to my boom script local surface, and I'm going to use the workspace terrain as the 44 00:02:19,200 --> 00:02:19,770 surface. 45 00:02:19,770 --> 00:02:22,410 So that's not going to detonate the bomb. 46 00:02:22,410 --> 00:02:25,110 This is going to be an exclusion list right here. 47 00:02:25,110 --> 00:02:25,400 Right. 48 00:02:25,470 --> 00:02:26,760 But it's just going to be one value. 49 00:02:26,760 --> 00:02:28,080 So I'm not making it a list. 50 00:02:28,080 --> 00:02:34,860 It's an exclusion variable, say, local function on touch. 51 00:02:34,860 --> 00:02:36,930 So this is if somebody touches the plate. 52 00:02:37,560 --> 00:02:42,990 Other part, let's go ahead and get the touch event from the plate so we don't forget plate. 53 00:02:43,800 --> 00:02:52,980 There it is touched, connect on touch, get rid of those two extra parentheses that Roblox always adds. 54 00:02:52,980 --> 00:02:54,600 But you only want the function name. 55 00:02:54,600 --> 00:02:55,860 You don't want the parentheses. 56 00:02:56,160 --> 00:03:04,440 Now, if the other part does not equal, it's the little tilde, little tilde, the little squiggly 57 00:03:04,440 --> 00:03:12,870 thing that's not equal to surface and can touch is true. 58 00:03:13,020 --> 00:03:14,760 Then we're going to do our explosion. 59 00:03:14,760 --> 00:03:18,870 But first we're going to say, Oh, I had can touch. 60 00:03:18,870 --> 00:03:20,340 I meant can't explode. 61 00:03:20,340 --> 00:03:22,500 We're going to make can explode false. 62 00:03:22,500 --> 00:03:25,680 So this is each bomb is only going to be able to go off one time. 63 00:03:26,940 --> 00:03:27,810 False. 64 00:03:28,440 --> 00:03:29,100 It's done. 65 00:03:29,100 --> 00:03:30,480 It will no longer explode. 66 00:03:30,480 --> 00:03:31,410 After this point. 67 00:03:32,670 --> 00:03:41,130 We're going to make a variable for our explosion exp for explosion instance, that new explosion or 68 00:03:41,130 --> 00:03:49,830 parent it to we're comparing it to the to the plate, repairing it to the workspace if we wanted to. 69 00:03:50,100 --> 00:03:51,780 Let's do that now. 70 00:03:51,780 --> 00:03:52,170 It's good. 71 00:03:52,170 --> 00:03:52,470 It's good. 72 00:03:52,470 --> 00:03:55,770 Like this plate and what else? 73 00:03:55,800 --> 00:03:59,010 Exp position. 74 00:04:00,120 --> 00:04:04,380 If you don't give it a position, it's going to blow up blow up at at the 000 part of the world, which 75 00:04:04,380 --> 00:04:04,980 is no good. 76 00:04:04,980 --> 00:04:07,290 We want to blow up where someone steps on it. 77 00:04:07,290 --> 00:04:08,460 So when I say plate. 78 00:04:11,160 --> 00:04:12,180 Possession. 79 00:04:12,300 --> 00:04:14,010 That's where the explosion is going to happen. 80 00:04:14,730 --> 00:04:17,490 We'll use the default blast pressure. 81 00:04:17,490 --> 00:04:19,800 So we probably don't even need to set this. 82 00:04:19,800 --> 00:04:27,510 But just so that you see that there's a blast blast pressure variable or property, it's normally 500,000, 83 00:04:28,080 --> 00:04:29,640 so I'll make it 500,000. 84 00:04:30,240 --> 00:04:33,150 Blast radius is going to make the biggest difference. 85 00:04:33,150 --> 00:04:37,530 So if you do a blast radius too big, we're going to blow up too many things. 86 00:04:37,530 --> 00:04:39,120 So let's make it like five. 87 00:04:39,890 --> 00:04:40,220 All right. 88 00:04:40,320 --> 00:04:41,010 What else? 89 00:04:41,700 --> 00:04:52,890 We can blow holes in the terrain, but I think I'm going to set explosion type to enum explosion type. 90 00:04:53,820 --> 00:04:55,290 No craters. 91 00:04:55,290 --> 00:04:57,030 I don't want any craters in my terrain. 92 00:04:58,900 --> 00:05:00,460 And then we'll play our sound. 93 00:05:00,510 --> 00:05:02,350 Sound play. 94 00:05:04,500 --> 00:05:12,780 Then let's turn the plate transparency off. 95 00:05:14,340 --> 00:05:18,420 I'm not going to worry about the lid because it's going to go flying and then we're going to actually 96 00:05:18,810 --> 00:05:22,770 destroy everything after the explosion and the sound plays. 97 00:05:22,770 --> 00:05:27,570 So I'm just going to make the plate transparency invisible. 98 00:05:28,470 --> 00:05:29,580 Make that one. 99 00:05:30,600 --> 00:05:36,420 I'll get my debris, my debris service add item. 100 00:05:37,990 --> 00:05:40,780 And that's going to be the model, the land mine. 101 00:05:41,020 --> 00:05:48,580 And we will make it disappear after 2 seconds because our sound explosion. 102 00:05:49,680 --> 00:05:53,640 Is 1.9 seconds long, so it might as well wait for the sound to play. 103 00:05:54,300 --> 00:05:57,540 We put the sound on the plate and that will destroy everything. 104 00:05:58,370 --> 00:05:58,760 All right. 105 00:05:58,820 --> 00:05:59,400 That's pretty good. 106 00:05:59,420 --> 00:06:04,220 I will put this in the resources in the folder so that you can download it. 107 00:06:06,000 --> 00:06:06,420 All right. 108 00:06:06,420 --> 00:06:09,720 In order to test this, let's make a couple of them. 109 00:06:10,510 --> 00:06:12,880 I just had control to duplicate it. 110 00:06:13,420 --> 00:06:14,890 Just drag that over. 111 00:06:16,200 --> 00:06:17,370 Control day. 112 00:06:18,440 --> 00:06:21,220 I'll do three and play. 113 00:06:25,340 --> 00:06:27,810 Let's look at our view tab output. 114 00:06:27,830 --> 00:06:29,060 Make sure there's no. 115 00:06:29,180 --> 00:06:30,440 Make sure there's no errors. 116 00:06:30,470 --> 00:06:32,000 Let's turn our zombies on. 117 00:06:38,160 --> 00:06:38,620 Whoa. 118 00:06:39,370 --> 00:06:40,260 Almost got me. 119 00:06:41,260 --> 00:06:41,520 Yeah. 120 00:06:41,520 --> 00:06:42,660 We go over here. 121 00:06:43,380 --> 00:06:44,650 Run through the minefield. 122 00:06:44,670 --> 00:06:46,620 Careful not to touch any of the plates. 123 00:06:50,490 --> 00:06:50,970 Ha. 124 00:06:51,600 --> 00:06:52,400 Nice. 125 00:06:52,410 --> 00:06:53,340 And a body part. 126 00:06:53,430 --> 00:06:54,840 Made the boulder roll. 127 00:06:54,960 --> 00:06:56,010 That's pretty cool. 128 00:06:56,040 --> 00:06:56,550 All right. 129 00:06:56,550 --> 00:06:57,960 So good luck with that. 130 00:06:57,960 --> 00:07:00,270 And I will see you in the next video.